<%@page import="com.zh.tea.service.impl.FeedbackServiceImpl"%>
<%@page import="com.zh.tea.service.FeedbackService"%>
<%@page import="java.util.*,com.zh.tea.entity.Feedback"%>
<%@ page language="java" contentType="text/html; charset=utf-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>茶商后台管理</title>
<!-- 管理员查看contact提交的所有反馈
页面用的后台页面的格式，js没有对上
本页面我的代码只有function chk和<div class="layui-body">部分，可以拷贝出去
 -->
<link rel="stylesheet" href="css/layui.css" media="all">
</head>
<script src="js/layui.js"></script>
<script type="text/javascript">
function chk(id){
	  if(confirm("你确定要删除吗？"))
     {
        location.href="FeedbackServlet?opt=del&id="+id;
     }

}
	function openwin() {
		window.open(
						"UpdateGoods.html",
						"",
						"height:50,width=50,toolbar=no,menubar=no,scrollbar=no,resizable=no,location=no,status=no,top=50,left=50")
	}
</script>
<body class="layui-layout-body">
	<div class="layui-layout layui-layout-admin">
		<div class="layui-header">
			<div class="layui-logo">醉品茶城</div>
			<!-- 头部区域（可配合layui已有的水平导航） -->
			<ul class="layui-nav layui-layout-left">
				<li class="layui-nav-item"><a href="ShowUser.html">用户信息</a></li>
				<li class="layui-nav-item"><a href="ShowGoods.html">商品信息</a></li>
				<li class="layui-nav-item"><a href="ShowOrder.html">订单信息</a></li>
				<li class="layui-nav-item"><a href="javascript:;">其它系统</a>
					<dl class="layui-nav-child">
						<dd>
							<a href="">邮件管理</a>
						</dd>
						<dd>
							<a href="">消息管理</a>
						</dd>
						<dd>
							<a href="">授权管理</a>
						</dd>
					</dl></li>
			</ul>

			<ul class="layui-nav layui-layout-right">
				<li class="layui-nav-item"><a href="javascript:;"> <img
						src="http://t.cn/RCzsdCq" class="layui-nav-img"> 用户名
				</a></li>
				<li class="layui-nav-item"><a href="">退出</a></li>
			</ul>
		</div>

		<div class="layui-side layui-bg-black">
			<div class="layui-side-scroll">
				<!-- 左侧导航区域（可配合layui已有的垂直导航） -->
				<ul class="layui-nav layui-nav-tree" lay-filter="test">
					<li class="layui-nav-item layui-nav-itemed"><a class=""
						href="javascript:;">用户管理</a>
						<dl class="layui-nav-child">
							<dd>
								<a href="userUpdate.html">用户修改</a>
							</dd>
							<dd>
								<a href="userDel.html">用户删除</a>
							</dd>
						</dl></li>
					<li class="layui-nav-item"><a href="javascript:;">订单管理</a>
						<dl class="layui-nav-child">
							<dd>
								<a href="OrderUpdate.html">订单修改</a>
							</dd>
							<dd>
								<a href="OrderDel.html">订单删除</a>
							</dd>
						</dl></li>
					<li class="layui-nav-item"><a href="javascript:;">商品管理</a>
						<dl class="layui-nav-child">
							<dd>
								<a href="GoodsInsert.html">商品增加</a>
							</dd>
							<dd>
								<a href="GoodsUpdate.html">商品更新</a>
							</dd>
							<dd>
								<a href="GoodsDel.html">商品删除</a>
							</dd>
						</dl></li>
					<li class="layui-nav-item"><a href="">发布商品</a></li>
				</ul>
			</div>
		</div>

		<div class="layui-body">
			<!-- 内容主体区域 -->
			<div style="padding: 15px;">
				<table lay-filter="parse-table-demo">
					<thead>
						<tr>
							<th lay-data="{field:'username', width:200}">序号</th>
							<th lay-data="{field:'joinTime', width:150}">姓名</th>
							<th lay-data="{field:'sign', minWidth: 180}">电话</th>
							<th lay-data="{field:'take', minWidth: 180}">反馈</th>
							<th></th>
						</tr>
					</thead>
					<tbody>
						<c:if test="${list==null }">
							<jsp:forward page="FeedbackServlet?opt=selAll"></jsp:forward>
						</c:if>
						<c:choose>
							<c:when test="${list.size()==0 }"> 暂无反馈</c:when>
							<c:otherwise>
								<c:forEach var="feed" items="${list}" varStatus="status">
									<tr>
										<td><c:out value="${feed.id}" /></td>
										<td><c:out value="${feed.name}" /></td>
										<td><c:out value="${feed.phone}" /></td>
										<td><c:out value="${feed.content}" /></td>
										<td><button 
									onclick="chk(${feed.id});">删除</button></td>
									</tr>
								</c:forEach>
							</c:otherwise>
						</c:choose>
					</tbody>
				</table>
				<c:remove var="list"/>
			</div>
		</div>
		<!-- 底部区域 -->
		<div class="layui-footer" style="text-align: center">©
			chachegn.com - 醉品商城</div>
	</div>
	<script>
		//JavaScript代码区域：左侧的下拉列表
		layui.use('element', function() {
			var element = layui.element;
		});
		layui.use('table', function() {
			var table = layui.table;
			table.init('parse-table-demo')
			$('.demoTable .layui-btn').on('click', function() {
				var type = $(this).data('type');
				active[type] ? active[type].call(this) : '';
			});
		});
	</script>
</body>
</html>
